/**
 * 
 */
package test.common.distributed.sharding.ibatis.dao.impl;

import java.util.Map;

import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;

import test.common.distributed.sharding.ibatis.dao.IDemoDao;
import test.common.distributed.sharding.ibatis.model.DemoModel;

/**
 * @author liubing
 *
 */
public class DemoDaoImpl extends SqlMapClientDaoSupport implements IDemoDao {

	/* (non-Javadoc)
	 * @see test.common.distributed.sharding.ibatis.dao.IDemoDao#insert(test.common.distributed.sharding.ibatis.model.DemoModel)
	 */
	@Override
	public void insert(DemoModel demoModel) throws Exception{
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().insert("demo.insert",demoModel);
	}

	/* (non-Javadoc)
	 * @see test.common.distributed.sharding.ibatis.dao.IDemoDao#delete(java.lang.Integer)
	 */
	@Override
	public void delete(Integer id) throws Exception{
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().delete("demo.delete", id);
	}

	/* (non-Javadoc)
	 * @see test.common.distributed.sharding.ibatis.dao.IDemoDao#update(test.common.distributed.sharding.ibatis.model.DemoModel)
	 */
	@Override
	public void update(DemoModel demoModel) throws Exception{
		// TODO Auto-generated method stub
		getSqlMapClientTemplate().update("dmo.update", demoModel);
	}

	/* (non-Javadoc)
	 * @see test.common.distributed.sharding.ibatis.dao.IDemoDao#findById(java.lang.Integer)
	 */
	@Override
	public DemoModel findById(Integer id) throws Exception{
		// TODO Auto-generated method stub
		return (DemoModel) getSqlMapClientTemplate().queryForObject("demo.findById", id);
	}

}
